import 'package:distribution_mall_flutter/generated/json/base/json_convert_content.dart';
import 'package:distribution_mall_flutter/pages/merchant_authentication/state/merchant_authentication_state.dart';
import 'package:distribution_mall_flutter/pages/merchant_authentication/domain/merchant_auth_last_entity.dart';

import 'package:flutter/material.dart';


MerchantAuthenticationState $MerchantAuthenticationStateFromJson(
    Map<String, dynamic> json) {
  final MerchantAuthenticationState merchantAuthenticationState = MerchantAuthenticationState();
  final MerchantAuthLastBody? merchantAuthLastBody = jsonConvert.convert<
      MerchantAuthLastBody>(json['merchantAuthLastBody']);
  if (merchantAuthLastBody != null) {
    merchantAuthenticationState.merchantAuthLastBody = merchantAuthLastBody;
  }
  final bool? loadSuccess = jsonConvert.convert<bool>(json['loadSuccess']);
  if (loadSuccess != null) {
    merchantAuthenticationState.loadSuccess = loadSuccess;
  }
  return merchantAuthenticationState;
}

Map<String, dynamic> $MerchantAuthenticationStateToJson(
    MerchantAuthenticationState entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['merchantAuthLastBody'] = entity.merchantAuthLastBody?.toJson();
  data['loadSuccess'] = entity.loadSuccess;
  return data;
}

extension MerchantAuthenticationStateExtension on MerchantAuthenticationState {
  MerchantAuthenticationState copyWith({
    MerchantAuthLastBody? merchantAuthLastBody,
    bool? loadSuccess,
    TextEditingController? businessNameController,
    TextEditingController? phoneNumberController,
    TextEditingController? certificateNoController,
    TextEditingController? addressController,
    TextEditingController? addressDetailController,
  }) {
    return MerchantAuthenticationState()
      ..merchantAuthLastBody = merchantAuthLastBody ?? this.merchantAuthLastBody
      ..loadSuccess = loadSuccess ?? this.loadSuccess
      ..businessNameController = businessNameController ??
          this.businessNameController
      ..phoneNumberController = phoneNumberController ??
          this.phoneNumberController
      ..certificateNoController = certificateNoController ??
          this.certificateNoController
      ..addressController = addressController ?? this.addressController
      ..addressDetailController = addressDetailController ??
          this.addressDetailController;
  }
}